import { ReactElement } from 'react'
import style from './index.module.less'

interface Props {
  value?: string
  format?: (v?: string | number) => string
}

function Main ({ value, format }: Props): ReactElement {
  const v = typeof format === 'function' ? format(value) : value
  return (
    <span className={style.container}>{v || '无'}</span>
  )
}

export default Main
